<section class="panel profile-edit clearfix">
  <header class="panel-header with-hr clearfix">
    <h1 class="panel-title">个人资料</h1>
  </header>
  <div class="person-info clearfix">
    <%= form_for @user, url: profile_path, method: :put, html: { class: "form-default" } do |f| %>
      <div class="user-name clearfix">
        <label>用户名</label>
        <%= f.text_field :name %>
      </div>
      <div class="email clearfix">
        <label>邮箱</label>
        <%= f.email_field :email %>
        <span class="verify-btn">验证</span>
      </div>
      <div class="introduction clearfix">
        <label>个人介绍</label>
        <%= f.text_area :bio, rows: 25 %>
      </div>
      <div class="btn-operate clearfix">
        <button type="submit" class="btn-default btn-warning">更新</button>
      </div>
    <% end %>
    <div class="avatar-wrap">
      <div class="edit-avatar clearfix">
        <div>
          <%= image_tag @user.avatar.url, class: "avatar" %>
          <span class="user-name"><%= @user.name %></span>
        </div>
        <%= form_for @user, url: profile_path, method: :put do |f| %>
          <a href="#" class="btn-default">修改头像</a>
          <%= f.file_field :avatar, id: "modify_avatar", accept: "image/*", required: false %>
        <% end %>
      </div>
    </div>
  </div>
</section>
<section class="panel profile-edit clearfix">
  <header class="panel-header with-hr clearfix">
    <h1 class="panel-title">修改密码</h1>
  </header>
  <div class="edit-password clearfix">
    <%= form_for @user, url: profile_path, method: :put, html: { class: "form-default" } do |f| %>
      <div class="clearfix">
        <label>原密码</label>
        <%= f.password_field :original_password %>
      </div>
      <div class="clearfix">
        <label>新密码</label>
        <%= f.password_field :password %>
      </div>
      <div class="clearfix">
        <label>确认密码</label>
        <%= f.password_field :password_confirmation %>
      </div>
      <div class="btn-operate clearfix">
        <button type="submit" class="btn-default btn-warning">修改</button>
      </div>
    <% end %>
  </div>
</section>
